//
//  FirstNavigationView.m
//  L7_test
//
//  Created by Mac on 11-12-29.
//  Copyright (c) 2011年 __MyCompanyName__. All rights reserved.
//

#import "FirstNavigationView.h"
#import "ShopListController.h"
#import "DetailShopViewController.h"
@implementation FirstNavigationView
@synthesize showDetailShopImg1;
@synthesize showDetailShopImg2;
@synthesize showDetailShopImg3;
@synthesize showDetailShopImg4;
@synthesize showDetailShopImg5;
@synthesize showDetailShopImg6;


- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
    }
    return self;
}



- (void)viewDidLoad
{
    //添加最近浏览商家图片
    UIImage *buttonImageNormal = [UIImage imageNamed:@"apple.png"];
    [showDetailShopImg1 setBackgroundImage:buttonImageNormal forState:UIControlStateNormal];
    [showDetailShopImg2 setBackgroundImage:buttonImageNormal forState:UIControlStateNormal];
    [showDetailShopImg3 setBackgroundImage:buttonImageNormal forState:UIControlStateNormal];
    [showDetailShopImg4 setBackgroundImage:buttonImageNormal forState:UIControlStateNormal];
    [showDetailShopImg5 setBackgroundImage:buttonImageNormal forState:UIControlStateNormal];
    [showDetailShopImg6 setBackgroundImage:buttonImageNormal forState:UIControlStateNormal];
    //设置视图title
    self.title=@"返回";
    [super viewDidLoad];
}

//隐藏导航栏
- (void)viewWillAppear:(BOOL)animated{
    self.navigationController.navigationBarHidden=YES; 
}

//显示商家列表信息
- (IBAction)showShopBtn:(id)sender {
    //创建新的试图并将试图推入栈中
    ShopListController *shopListController = [[ShopListController alloc]initWithNibName:@"ShopListController" bundle:nil];
    UINavigationController  *theNavController = [[UINavigationController alloc]
                                                 initWithRootViewController:shopListController];
    [shopListController release];
    theNavController.navigationBar.tintColor = [UIColor blackColor];
    [self.navigationController pushViewController: shopListController animated:YES];
    [theNavController release];
}

//显示商家详细信息
- (IBAction)showDetailShop:(id)sender {
    //创建新的试图并将试图推入栈中
    DetailShopViewController *detailShopViewController = [[DetailShopViewController alloc]initWithNibName:@"DetailShopViewController" bundle:nil];
    UINavigationController  *theNavController = [[UINavigationController alloc]
                                                 initWithRootViewController:detailShopViewController];
    [detailShopViewController release];
    theNavController.navigationBar.tintColor = [UIColor blackColor];
    [self.navigationController pushViewController: detailShopViewController animated:YES];
    [theNavController release];
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
}

- (void)viewDidUnload
{
    [self setShowDetailShopImg1:nil];
    [self setShowDetailShopImg2:nil];
    [self setShowDetailShopImg3:nil];
    [self setShowDetailShopImg4:nil];
    [self setShowDetailShopImg5:nil];
    [self setShowDetailShopImg6:nil];
    [super viewDidUnload];
}

- (void)dealloc {
    [showDetailShopImg1 release];
    [showDetailShopImg2 release];
    [showDetailShopImg3 release];
    [showDetailShopImg4 release];
    [showDetailShopImg5 release];
    [showDetailShopImg6 release];
    [super dealloc];
}
@end
